package com.ethink.order.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.SaleReturnDetailOrderInfo;
import com.ethink.order.api.model.SaleReturnModeModel;
import com.ethink.order.api.model.SaleReturnModel;
import com.ethink.order.api.request.SaleReturnOrderAddRequest;
import com.ethink.order.api.request.SaleReturnOrderQueryModeRequest;
import com.ethink.order.api.request.SaleReturnOrderQueryRequest;
import com.ethink.order.api.request.SaleReturnOrderUpdateRequest;
import com.ethink.order.api.response.SaleReturnOrderAddResponse;
import com.ethink.order.api.response.SaleReturnQueryDetailResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 销售退单 Facade接口
 *
 * @author default
 * @date 2022-12-09
 */
@FeignClient(name = "ethink-order-service", path = "order-service/facade/v1/saleReturnOrder", contextId = "saleReturnOrderFacade")
public interface SaleReturnOrderFacade {


    @PostMapping("add")
    @ResponseBody
    SaleReturnOrderAddResponse add(@RequestBody SaleReturnOrderAddRequest request);

    @PostMapping("pageQuery")
    @ResponseBody
    Page<SaleReturnModel> pageQuery(@RequestBody SaleReturnOrderQueryRequest request);


    @GetMapping("queryDetail")
    @ResponseBody
    SaleReturnQueryDetailResponse queryDetail(@RequestParam("id") Long id);


    @PostMapping("update")
    @ResponseBody
    Boolean update(@RequestBody SaleReturnOrderUpdateRequest request);

    @GetMapping("delete")
    @ResponseBody
    Boolean delete(@RequestParam("id") Long id);


    @GetMapping("pass")
    @ResponseBody
    Boolean pass(@RequestParam("id") Long id);

    @GetMapping("refuse")
    @ResponseBody
    Boolean refuse(@RequestParam("id") Long id);

    @GetMapping("queryDetailListBySaleOrderNo")
    @ResponseBody
    List<SaleReturnDetailOrderInfo> queryDetailListBySaleOrderNo(@RequestParam("saleOrderNo") String saleOrderNo);

    @PostMapping("/querySaleReturnDetailOrderNoByOrderNo")
    @ResponseBody
    List<String> querySaleReturnDetailOrderNoByOrderNo(@RequestBody List<String> orderNos);

    @PostMapping("/pageSaleReturnModeModel")
    @ResponseBody
    Page<SaleReturnModeModel> pageQueryMode(@RequestBody SaleReturnOrderQueryModeRequest request);

}